package test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.opera.OperaDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;

import java.io.File;
import java.io.IOException;

public class testng {

    @Test
    public void init() throws IOException{
        //System.setProperty("webdriver.opera.driver", "D:\\soft\\test\\selenium3\\driver\\operadriver.exe");

        String name="webdriver.opera.driver";
        String path=new File("./").getCanonicalPath()+"/src/driver/operadriver.exe";
        System.setProperty(name,path);



        WebDriver wd=new OperaDriver();
        wd.manage().window().maximize();
        wd.get("http://www.baidu.com");

        WebDriverWait  wait = new WebDriverWait(wd,10,1);



        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }




        wd.quit();


    }
}
